//package com.mp.approvalreq.servlet.other.module;
//
//import com.alibaba.fastjson.JSONObject;
//import com.mp.approvalreq.entity.dto.ExchangeTemplateDTO;
//import com.mp.approvalreq.service.ApprovalOperateServicePrx;
//import com.mp.approvalreq.servlet.AbstractServlet;
//import com.mp.approvalreq.util.ServiceUtils;
//import com.plusmoney.exception.RpcServerLogicalException;
//import com.plusmoney.message.SuccessMsg;
//import com.plusmoney.util.Utils;
//import org.apache.commons.lang3.StringUtils;
//import org.slf4j.Logger;
//import org.slf4j.LoggerFactory;
//
//import javax.servlet.ServletException;
//import javax.servlet.annotation.WebServlet;
//import javax.servlet.http.HttpServletRequest;
//import javax.servlet.http.HttpServletResponse;
//import java.io.IOException;
//
//@WebServlet("/exchangeGeneralRequestFlow")
//@Deprecated
//public class ExchangeGeneralRequestFlow extends AbstractServlet {
//    private static final Logger logger = LoggerFactory.getLogger(ExchangeGeneralRequestFlow.class);
//
//    @Override
//    protected void doPost(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException {
//        try {
//            ExchangeTemplateDTO exchangeTemplateDTO = getExchangeTemplateDTO(req);
//            check(exchangeTemplateDTO);
//
//            ApprovalOperateServicePrx approvalOperateServicePrx = ServiceUtils.getApprovalOperateServicePrx();
//            approvalOperateServicePrx.exchangeGeneralRequestFlows(exchangeTemplateDTO);
//
//            String msg = SuccessMsg.getDefaultMsg();
//
//            logger.info("输出json:{}", msg);
//
//            printJson(resp, msg);
//        } catch (Throwable e) {
//            onThrowable(req, resp, e);
//        }
//    }
//
//    private ExchangeTemplateDTO getExchangeTemplateDTO(HttpServletRequest req) throws IOException {
//        String reqBody = getContent(req);
//        logger.info("输入json:{}", reqBody);
//
//        ExchangeTemplateDTO exchangeTemplateDTO;
//        try {
//            exchangeTemplateDTO = JSONObject.parseObject(reqBody, ExchangeTemplateDTO.class);
//        } catch (Throwable e) {
//            logger.error(e.getMessage(), e);
//            throw new RpcServerLogicalException(1, "参数格式不正确");
//        }
//
//        return exchangeTemplateDTO;
//    }
//
//    private void check(ExchangeTemplateDTO exchangeTemplateDTO) {
//        if (Utils.isNull(exchangeTemplateDTO)) {
//            throw new RpcServerLogicalException(1, "参数不能为空");
//        }
//
//        if (Utils.isNull(exchangeTemplateDTO.getQuitContactId())) {
//            throw new RpcServerLogicalException(1, "离职人id不能为空");
//        }
//
//        if (Utils.isNull(exchangeTemplateDTO.getReceiveContactId())) {
//            throw new RpcServerLogicalException(1, "交接人id不能为空");
//        }
//
//        if (StringUtils.isEmpty(exchangeTemplateDTO.getProjectIds())) {
//            throw new RpcServerLogicalException(1, "工程id不能为空");
//        }
//
//        if (Utils.isNull(exchangeTemplateDTO.getCompanyId())) {
//            throw new RpcServerLogicalException(1, "公司id不能为空");
//        }
//
//    }
//
//}
